
gtestdir = /Users/wasti/Documents/tests/gtest-1.6.0
boostdir = /Users/wasti/Documents/boost

# GCC 4.6 settings
#CC = g++-4.6
#CXX = g++-4.6
#CXXFLAGS = -I.. -I$(gtestdir)/include \
#  -std=c++0x -Werror -Wall -pedantic -Wno-unused-variable -g -O0
#LDFLAGS = -L$(gtestdir)/libgcc -g -O0
#LDLIBS = -lgtest -lgtest_main

# Clang settings
CC = /usr/local/bin/clang++
CXX = /usr/local/bin/clang++
CXXFLAGS = -std=c++11 -I../include -I$(gtestdir)/include \
  -I$(boostdir) -stdlib=libc++ -U__STRICT_ANSI__ -DGTEST_USE_OWN_TR1_TUPLE \
  -g -O0 -Werror
LDFLAGS = -stdlib=libc++ -g -O0 -L$(gtestdir)/libclang
LDLIBS = -lgtest_main -lgtest -lc++abi

test_suites = random_access_iterator_adaptor input_iterator_adaptor all_of \
  any_of concat find take take_while for_each filter count reverse rotate \
  filtered_rotate tag_functions concat_rotate concat_reverse map mismatch zip

run : test
	./test

test : test.o $(test_suites:=.o)

%.o : %.cpp
	$(CXX) -c $(CXXFLAGS) -MD -o $@ $<
	@cp $*.d $*.P; \
	  sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
	      -e '/^$$/ d' -e 's/$$/ :/' < $*.d >> $*.P; \
	  rm -f $*.d

-include $(test_suites:=.P)

clean:
	-rm test *.o *.P

.PHONY: clean run
